package com.pshare.artemis.parkingdevice.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.pshare.artemis.parkingdevice.bean.Gateway;
import com.pshare.artemis.parkingdevice.vo.GatewayUserVO;
import com.pshare.framework.mapper.BaseMapper;
import com.pshare.framework.page.PageInfo;

public interface GatewayMapper extends BaseMapper<Long,Gateway>{
	@Override
	@Insert("insert into tbl_gateway (id, name, mac) values (#{id},#{name},#{mac})")
	int add(Gateway gateway);
	
	@Select("select * from tbl_gateway where mac=#{mac} ")
	Gateway getByMac(@Param("mac") String mac);
	
	@Update(" update  tbl_gateway set validate_pwd=#{validatePwd} where id=#{id} ")
	void updateVpwd(Gateway bean);
	
	@Select("select * from tbl_gateway where user_id=#{userId} ")
	List<Gateway> getListByUserId(@Param("userId") Long userId);
	
}
